package com.xqboss.apps.dto.synthesis;

import com.xqboss.apps.domain.synthesis.SynthesisHoldCondition;
import com.xqboss.apps.domain.synthesis.SynthesisPlanStatus;
import com.xqboss.apps.domain.synthesis.SynthesisWhite;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Administrator
 */
@Data
@ApiModel(value = "活动基础配置新增修改入参", description = "接收参数")
public class SynthesisMainSaveUpdateDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "活动名称")
    @NotEmpty(message = "活动名称不可为空")
    @Length(max = 50, message = "活动名称长度超出限制")
    private String name;

    @ApiModelProperty(value = "主图")
    @NotEmpty(message = "主图不可为空")
    @Length(max = 255, message = "主图链接长度超出限制")
    private String mainImg;

    @ApiModelProperty(value = "详情主图")
    @NotEmpty(message = "详情主图不可为空")
    @Length(max = 255, message = "详情主图链接长度超出限制")
    private String detailImg;

    @ApiModelProperty(value = "公告id")
    private Long msgId;

    @ApiModelProperty(value = "方案id")
    @NotNull(message = "规则方案id不可为空")
    private Long planId;

    @ApiModelProperty(value = "身份id")
    private Long identityRankId;

    @ApiModelProperty(value = "开始时间")
    @NotNull(message = "开始时间不可为空")
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "分类id[category表]")
    @NotNull(message = "分类id不可为空")
    @Min(value = 0, message = "分类id格式不合法")
    private Long categoryId;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "用户合成限制最大数")
    @Min(value = 0, message = "是否显示格式不合法")
    private Integer userMaxNum;

    @ApiModelProperty(value = "用户单次合成限制最大数")
    @Min(value = 0, message = "是否显示格式不合法")
    private Integer userSingleMaxNum;

    @ApiModelProperty(value = "普通合成份数")
    @Min(value = 0, message = "普通合成份数格式不合法")
    @NotNull(message = "普通合成份数不可为空")
    private Integer num;

    @ApiModelProperty(value = "虚拟销量")
    @Min(value = 0, message = "虚拟销量格式不合法")
    @NotNull(message = "虚拟销量不可为空")
    private Integer simulatedSales;

    @ApiModelProperty(value = "是否显示[1:显示;0:不显示]")
    @NotNull(message = "是否显示不可为空")
    @Min(value = 0, message = "是否显示格式不合法")
    @Max(value = 1, message = "是否显示格式不合法")
    private Integer show;

    @ApiModelProperty(value = "排序")
    @NotNull(message = "排序不可为空")
    private Integer sort;

    @ApiModelProperty(value = "持图开关[1:开启;0:关闭]")
    @NotNull(message = "持图开关不可为空")
    @Min(value = 0, message = "持图开关格式不合法")
    @Max(value = 1, message = "持图开关格式不合法")
    private Integer hold;

    @ApiModelProperty(value = "持图查询时间")
    private LocalDateTime holdTime;

    @ApiModelProperty(value = "持图类型 1不限 2按次数")
    private Integer holdType;

    @ApiModelProperty(value = "白名单开关[1:开启;0:关闭]")
    @NotNull(message = "白名单开关不可为空")
    @Min(value = 0, message = "白名单开关格式不合法")
    @Max(value = 1, message = "白名单开关格式不合法")
    private Integer white;

    @ApiModelProperty(value = "白名单库存")
    @Min(value = 0, message = "白名单库存格式不合法")
    @NotNull(message = "白名单库存不可为空")
    private Integer whiteNum;

    @ApiModelProperty(value = "白名单开始时间")
    private LocalDateTime whiteTime;

    @ApiModelProperty(value = "活动-状态")
    @NotNull(message = "活动-方案状态不可为空")
    private List<SynthesisPlanStatus> status;

    @ApiModelProperty(value = "持图配置-材料")
    private List<SynthesisHoldCondition> holdCondition;

    @ApiModelProperty(value = "白名单")
    private List<SynthesisWhite> whiteList;


    @ApiModelProperty(value = "白名单虚拟销量")
    @Min(value = 0, message = "白名单虚拟销量格式不合法")
    @NotNull(message = "白名单虚拟销量不可为空")
    private Integer whiteSimulatedSales;

}
